using System.Web.Mvc;
using ExtendedMvc.Html;

namespace ExtendedMvc.Elements {
	public class Literal : LiteralBase<Literal> {
		public Literal(string text = null, string id = null) : base(text, id) { }
	}

	public abstract class LiteralBase<T> : VisibleElement<T> where T : LiteralBase<T> {
		private string _text { get; set; }

		protected string text { get { return _text; } }

		protected LiteralBase(string text, string id = null)
			: base(HtmlTag.Span, id) {
			_text = text;
		}

		public virtual T Text(string value) {
			_text = value;
			return (T)this;
		}

		protected override TagRenderMode TagRenderMode { get { return TagRenderMode.Normal; } }

		protected override void SetContent() {
			Builder.InnerHtml = _text; //FormatContent(content);
		}
	}
}